package com.daoxuan.mvc.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 * @description: 测试controller
 * @author: wangqinglin
 * @date: 2020/8/11 17:28
 */

@RestController
public class SimpleController {

    @GetMapping("/mvc/{latency}")
    public String getInfo(@PathVariable int latency){
        try {
            TimeUnit.MILLISECONDS.sleep(latency);
        } catch (InterruptedException e) {
            return "Error during thread sleep!";
        }
        return "Hello World!";
    }
}
